package com.ruoyi.business.service;

import org.activiti.bpmn.model.BpmnModel;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

public interface IProcessService {

    Deployment deploy(String filePath) throws FileNotFoundException;

    /**
     * 根据流程部署ID找到对应的流程定义信息
     * @param deploymentId
     * @return
     */
    ProcessDefinition getProcessDefinitionByDeploymentId(String deploymentId);

    void addCandidateUser(Task task, Long userId);

    Task getTaskByProcessInstanceId(String processInstanceId);

    ProcessInstance startProcessInstance(String definitionKey, String businessKey, Map<String, Object> variables);

    InputStream getResourceAsStream(String deploymentId, String resourceName);

    InputStream getProcessImage(String processDefinitionId, List<String> highLightedActivities, List<String> highLightedFlows);

    InputStream getBpmnInputStream(String deploymentId);

    InputStream getProcessImg(String deployId);

    InputStream getProcessImgByInstanceId(String instanceId);

    void deleteProcessInstance(String instanceId);

    Long getTodoTaskCount(String definitionKey, String userId);

    List<Task> selectTodoTaskList(String definitionKey, String userId, Integer startNum, Integer pageSize);

    ProcessInstance getprocessInstanceById(String processInstanceId);

    Task getTaskByTaskId(String taskId);

    void claimAndComplete(Task task, String userId, Boolean auditStatus, String comment);

    void claimAndComplete(Task task, String userId, String comment);

    void setVariable(String taskId, String key, long longValue);

    Long getHistoricTaskCount(String definitionKey,String userId);

    List<HistoricTaskInstance> selectHistoricTaskList(String definitionKey, String userId, Integer firstResult, Integer pageSize);

    HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);

    List<HistoricActivityInstance> selectHistoricActivityList(String instanceId);

    String getComment(String taskId);

}
